home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Library
/
RoseWare - Network Support Library.iso
/
apidev
/
netdmo.exe
/
PRINT1.FRM
< prev
next >
Wrap
Text File
|
1993-12-10
|
18KB
|
723 lines
Version 1.00
BEGIN Form Print1
AutoRedraw = 0
BackColor = QBColor(1)
BorderStyle = 1
Caption = "Print1"
ControlBox = -1
Enabled = -1
ForeColor = QBColor(0)
Height = Char(22)
Left = Char(8)
MaxButton = -1
MinButton = -1
MousePointer = 0
Tag = ""
Top = Char(2)
Visible = -1
Width = Char(64)
WindowState = 0
BEGIN CommandButton Exit1
BackColor = QBColor(7)
Cancel = 0
Caption = "Exit"
Default = 0
DragMode = 0
Enabled = -1
Height = Char(3)
Left = Char(41)
MousePointer = 0
TabIndex = 0
TabStop = -1
Tag = ""
Top = Char(16)
Visible = -1
Width = Char(13)
END
BEGIN Frame Frame1
BackColor = QBColor(1)
Caption = ""
DragMode = 0
Enabled = -1
ForeColor = QBColor(15)
Height = Char(7)
Left = Char(2)
MousePointer = 0
TabIndex = 1
Tag = ""
Top = Char(3)
Visible = -1
Width = Char(25)
BEGIN OptionButton Banneryes
BackColor = QBColor(1)
Caption = "Yes"
DragMode = 0
Enabled = -1
ForeColor = QBColor(7)
Height = Char(1)
Left = Char(0)
MousePointer = 0
TabIndex = 3
TabStop = -1
Tag = ""
Top = Char(1)
Value = -1
Visible = -1
Width = Char(13)
END
BEGIN OptionButton BannerNo
BackColor = QBColor(1)
Caption = "No"
DragMode = 0
Enabled = -1
ForeColor = QBColor(7)
Height = Char(1)
Left = Char(13)
MousePointer = 0
TabIndex = 4
TabStop = 0
Tag = ""
Top = Char(1)
Value = 0
Visible = -1
Width = Char(7)
END
BEGIN Label Btextlab
Alignment = 0
AutoSize = 0
BackColor = QBColor(1)
BorderStyle = 0
Caption = "Banner Text:"
DragMode = 0
Enabled = -1
ForeColor = QBColor(7)
Height = Char(1)
Left = Char(0)
MousePointer = 0
TabIndex = 5
Tag = ""
Top = Char(3)
Visible = -1
Width = Char(12)
END
BEGIN TextBox Bannertext
BackColor = QBColor(1)
BorderStyle = 1
DragMode = 0
Enabled = -1
ForeColor = QBColor(15)
Height = Char(3)
Left = Char(13)
MousePointer = 0
MultiLine = 0
ScrollBars = 0
TabIndex = 6
TabStop = -1
Tag = ""
Text = " "
Top = Char(2)
Visible = -1
Width = Char(10)
END
BEGIN Label Label4
Alignment = 0
AutoSize = 0
BackColor = QBColor(1)
BorderStyle = 0
Caption = "BANNER"
DragMode = 0
Enabled = -1
ForeColor = QBColor(15)
Height = Char(1)
Left = Char(7)
MousePointer = 0
TabIndex = 21
Tag = ""
Top = Char(0)
Visible = -1
Width = Char(7)
END
END
BEGIN Label Capstatus
Alignment = 0
AutoSize = 0
BackColor = QBColor(1)
BorderStyle = 0
Caption = "Status:"
DragMode = 0
Enabled = -1
ForeColor = QBColor(15)
Height = Char(1)
Left = Char(2)
MousePointer = 0
TabIndex = 2
Tag = ""
Top = Char(1)
Visible = -1
Width = Char(29)
END
BEGIN Frame Frame2
BackColor = QBColor(1)
Caption = ""
DragMode = 0
Enabled = -1
ForeColor = QBColor(15)
Height = Char(7)
Left = Char(34)
MousePointer = 0
TabIndex = 7
Tag = ""
Top = Char(3)
Visible = -1
Width = Char(25)
BEGIN OptionButton TabsYes
BackColor = QBColor(1)
Caption = "Yes"
DragMode = 0
Enabled = -1
ForeColor = QBColor(7)
Height = Char(1)
Left = Char(0)
MousePointer = 0
TabIndex = 8
TabStop = -1
Tag = ""
Top = Char(1)
Value = -1
Visible = -1
Width = Char(10)
END
BEGIN OptionButton TabsNo
BackColor = QBColor(1)
Caption = "No"
DragMode = 0
Enabled = -1
ForeColor = QBColor(7)
Height = Char(1)
Left = Char(12)
MousePointer = 0
TabIndex = 9
TabStop = 0
Tag = ""
Top = Char(1)
Value = 0
Visible = -1
Width = Char(8)
END
BEGIN Label Label1
Alignment = 0
AutoSize = 0
BackColor = QBColor(1)
BorderStyle = 0
Caption = "Tab Size 1-18 :"
DragMode = 0
Enabled = -1
ForeColor = QBColor(7)
Height = Char(1)
Left = Char(0)
MousePointer = 0
TabIndex = 10
Tag = ""
Top = Char(3)
Visible = -1
Width = Char(16)
END
BEGIN TextBox Tabsize
BackColor = QBColor(1)
BorderStyle = 1
DragMode = 0
Enabled = -1
ForeColor = QBColor(15)
Height = Char(3)
Left = Char(15)
MousePointer = 0
MultiLine = 0
ScrollBars = 0
TabIndex = 11
TabStop = -1
Tag = ""
Text = ""
Top = Char(2)
Visible = -1
Width = Char(5)
END
BEGIN Label Label5
Alignment = 0
AutoSize = 0
BackColor = QBColor(1)
BorderStyle = 0
Caption = "TABS"
DragMode = 0
Enabled = -1
ForeColor = QBColor(15)
Height = Char(1)
Left = Char(9)
MousePointer = 0
TabIndex = 22
Tag = ""
Top = Char(0)
Visible = -1
Width = Char(5)
END
END
BEGIN Frame Frame3
BackColor = QBColor(1)
Caption = ""
DragMode = 0
Enabled = -1
ForeColor = QBColor(15)
Height = Char(6)
Left = Char(2)
MousePointer = 0
TabIndex = 12
Tag = ""
Top = Char(10)
Visible = -1
Width = Char(25)
BEGIN OptionButton FeedYes
BackColor = QBColor(1)
Caption = "Yes"
DragMode = 0
Enabled = -1
ForeColor = QBColor(7)
Height = Char(1)
Left = Char(0)
MousePointer = 0
TabIndex = 13
TabStop = -1
Tag = ""
Top = Char(2)
Value = -1
Visible = -1
Width = Char(9)
END
BEGIN OptionButton FeedNo
BackColor = QBColor(1)
Caption = "No"
DragMode = 0
Enabled = -1
ForeColor = QBColor(7)
Height = Char(1)
Left = Char(13)
MousePointer = 0
TabIndex = 14
TabStop = 0
Tag = ""
Top = Char(2)
Value = 0
Visible = -1
Width = Char(8)
END
BEGIN Label Label6
Alignment = 0
AutoSize = 0
BackColor = QBColor(1)
BorderStyle = 0
Caption = "FORM FEED"
DragMode = 0
Enabled = -1
ForeColor = QBColor(15)
Height = Char(1)
Left = Char(6)
MousePointer = 0
TabIndex = 23
Tag = ""
Top = Char(0)
Visible = -1
Width = Char(10)
END
END
BEGIN Frame Frame4
BackColor = QBColor(1)
Caption = ""
DragMode = 0
Enabled = -1
ForeColor = QBColor(15)
Height = Char(6)
Left = Char(34)
MousePointer = 0
TabIndex = 15
Tag = ""
Top = Char(10)
Visible = -1
Width = Char(25)
BEGIN Label Label2
Alignment = 0
AutoSize = 0
BackColor = QBColor(1)
BorderStyle = 0
Caption = "Number of Copies:"
DragMode = 0
Enabled = -1
ForeColor = QBColor(7)
Height = Char(1)
Left = Char(0)
MousePointer = 0
TabIndex = 16
Tag = ""
Top = Char(2)
Visible = -1
Width = Char(17)
END
BEGIN TextBox Copies
BackColor = QBColor(1)
BorderStyle = 1
DragMode = 0
Enabled = -1
ForeColor = QBColor(15)
Height = Char(3)
Left = Char(17)
MousePointer = 0
MultiLine = 0
ScrollBars = 0
TabIndex = 17
TabStop = -1
Tag = ""
Text = "1"
Top = Char(1)
Visible = -1
Width = Char(6)
END
BEGIN Label Label7
Alignment = 0
AutoSize = 0
BackColor = QBColor(1)
BorderStyle = 0
Caption = "COPIES"
DragMode = 0
Enabled = -1
ForeColor = QBColor(15)
Height = Char(1)
Left = Char(8)
MousePointer = 0
TabIndex = 24
Tag = ""
Top = Char(0)
Visible = -1
Width = Char(7)
END
END
BEGIN CommandButton Capture
BackColor = QBColor(7)
Cancel = 0
Caption = "Capture"
Default = 0
DragMode = 0
Enabled = -1
Height = Char(3)
Left = Char(8)
MousePointer = 0
TabIndex = 18
TabStop = -1
Tag = ""
Top = Char(16)
Visible = -1
Width = Char(13)
END
BEGIN Label Label3
Alignment = 0
AutoSize = 0
BackColor = QBColor(1)
BorderStyle = 0
Caption = "Timeout:"
DragMode = 0
Enabled = -1
ForeColor = QBColor(7)
Height = Char(1)
Left = Char(34)
MousePointer = 0
TabIndex = 19
Tag = ""
Top = Char(1)
Visible = -1
Width = Char(9)
END
BEGIN TextBox Timeout
BackColor = QBColor(1)
BorderStyle = 1
DragMode = 0
Enabled = -1
ForeColor = QBColor(15)
Height = Char(3)
Left = Char(43)
MousePointer = 0
MultiLine = 0
ScrollBars = 0
TabIndex = 20
TabStop = -1
Tag = ""
Text = ""
Top = Char(0)
Visible = -1
Width = Char(5)
END
BEGIN CommandButton Localmode
BackColor = QBColor(7)
Cancel = 0
Caption = "Local Mode"
Default = 0
DragMode = 0
Enabled = -1
Height = Char(3)
Left = Char(23)
MousePointer = 0
TabIndex = 25
TabStop = -1
Tag = ""
Top = Char(16)
Visible = -1
Width = Char(15)
END
END
'$FORM Netdemo
COMMON SHARED UName$
COMMON SHARED UserID$
COMMON SHARED LPTNum%
TYPE Capture
LPTNum AS INTEGER
ReturnCode AS INTEGER
END TYPE
TYPE CapStat
ReturnCode AS INTEGER
ConnID AS INTEGER
END TYPE
TYPE PFlags
Flags AS INTEGER
TabSize AS INTEGER
Copies AS INTEGER
BannerText AS STRING * 13
LPTNum AS INTEGER
TimeOut AS INTEGER
ReturnCode AS INTEGER
END TYPE
TYPE obinfo
ReturnCode AS INTEGER
ObjectType AS INTEGER
ObjectName AS STRING * 47
ObjectID AS STRING * 4
END TYPE
TYPE Obid
StrIn AS STRING * 4
StrOut AS STRING * 8
END TYPE
TYPE Queue
LPTNum AS INTEGER
QueueID AS STRING * 8
ReturnCode AS INTEGER
END TYPE
DECLARE SUB SetDefaultLocalPrinter (SDefPrinter AS Capture)
DECLARE SUB GetLPTCaptureStatus (CaptureStats AS CapStat)
DECLARE SUB GetPrintFlag (GPFlags AS PFlags)
DECLARE SUB SetPrintFlag (SPFlags AS PFlags)
DECLARE SUB GetObjectInfo (ObjectInfo AS obinfo)
DECLARE SUB ConvertObjectID (ID AS Obid)
DECLARE SUB EndSpecificLPTCapture (ECap AS Capture)
DECLARE SUB StartLPTCapture (SCap AS Capture)
DECLARE SUB SetCapturePrintQueue (CapQueue AS Queue)
SUB Capture_Click ()
DIM CaptureStats AS CapStat
DIM SPFlags AS PFlags
DIM ObjectInfo AS obinfo
DIM ID AS Obid
DIM ECap AS Capture
DIM SCap AS Capture
DIM CapQueue AS Queue
ECap.LPTNum = LPTNum%
SCap.LPTNum = LPTNum%
CapQueue.LPTNum = LPTNum%
CALL GetLPTCaptureStatus(CaptureStats)
IF CaptureStats.ReturnCode = 255 THEN
CALL EndSpecificLPTCapture(ECap)
SPFlags.TabSize = VAL(TabSize.text)
SPFlags.Copies = VAL(Copies.text)
SPFlags.BannerText = BannerText.text
SPFlags.TimeOut = VAL(TimeOut.text)
IF BannerNo.Value = -1 AND TabsNo.Value = -1 AND FeedNo.Value = -1 THEN
SPFlags.Flags = 8
END IF
IF BannerNo.Value = -1 AND TabsYes.Value = -1 AND FeedYes.Value = -1 THEN
SPFlags.Flags = 64
END IF
IF BannerNo.Value = -1 AND TabsYes.Value = -1 AND FeedNo.Value = -1 THEN
SPFlags.Flags = 72
END IF
IF BannerYes.Value = -1 AND TabsNo.Value = -1 AND FeedYes.Value = -1 THEN
SPFlags.Flags = 128
END IF
IF BannerYes.Value = -1 AND TabsNo.Value = -1 AND FeedNo.Value = -1 THEN
SPFlags.Flags = 136
END IF
IF BannerYes.Value = -1 AND TabsYes.Value = -1 AND FeedYes.Value = -1 THEN
SPFlags.Flags = 192
END IF
IF BannerNo.Value = -1 AND TabsNo.Value = -1 AND FeedYes.Value = -1 THEN
SPFlags.Flags = 0
END IF
CALL SetPrintFlags(SPFlags)
retryqueuename:
msg$ = "Do you want to change the queue?"
QYesNo = MSGBOX(msg$, 4, "QUEUE INFORMATION")
prompt$ = "Enter the queue name."
IF QYesNo = 6 THEN
queuename$ = INPUTBOX$(prompt$, "QUEUE NAME", "")
ObjectInfo.ObjectName = UCASE$(RTRIM$(queuename$))
ObjectInfo.ObjectType = 3
CALL GetObjectInfo(ObjectInfo)
IF ObjectInfo.ReturnCode = 252 THEN
msg$ = "Queue Not Found"
MSGBOX msg$, 1
GOTO retryqueuename
END IF
ID.StrIn = ObjectInfo.ObjectID
CALL ConvertObjectID(ID)
CapQueue.QueueID = ID.StrOut
CALL SetCapturePrintQueue(CapQueue)
END IF
CALL StartLPTCapture(SCap)
Capstatus.Caption = "CAPTURE STATUS: CAPTURED"
ELSE
SPFlags.TabSize = VAL(TabSize.text)
IF Copies.text = "" THEN Copies.text = "1"
SPFlags.Copies = VAL(Copies.text)
SPFlags.BannerText = BannerText.text
IF TimeOut.text = "" THEN TimeOut.text = "0"
SPFlags.TimeOut = VAL(TimeOut.text)
IF BannerNo.Value = -1 AND TabsNo.Value = -1 AND FeedNo.Value = -1 THEN
SPFlags.Flags = 8
END IF
IF BannerNo.Value = -1 AND TabsYes.Value = -1 AND FeedYes.Value = -1 THEN
SPFlags.Flags = 64
END IF
IF BannerNo.Value = -1 AND TabsYes.Value = -1 AND FeedNo.Value = -1 THEN
SPFlags.Flags = 72
END IF
IF BannerYes.Value = -1 AND TabsNo.Value = -1 AND FeedYes.Value = -1 THEN
SPFlags.Flags = 128
END IF
IF BannerYes.Value = -1 AND TabsNo.Value = -1 AND FeedNo.Value = -1 THEN
SPFlags.Flags = 136
END IF
IF BannerYes.Value = -1 AND TabsYes.Value = -1 AND FeedYes.Value = -1 THEN
SPFlags.Flags = 192
END IF
IF BannerNo.Value = -1 AND TabsNo.Value = -1 AND FeedYes.Value = -1 THEN
SPFlags.Flags = 0
END IF
CALL SetPrintFlags(SPFlags)
retryqueuename2:
prompt$ = "Enter the queue name."
queuename$ = INPUTBOX$(prompt$, "QUEUE NAME", "")
ObjectInfo.ObjectName = UCASE$(RTRIM$(queuename$))
ObjectInfo.ObjectType = 3
CALL GetObjectInfo(ObjectInfo)
IF ObjectInfo.ReturnCode = 252 THEN
msg$ = "Queue Not Found"
MSGBOX msg$, 1
GOTO retryqueuename2
END IF
ID.StrIn = ObjectInfo.ObjectID
CALL ConvertObjectID(ID)
CapQueue.QueueID = ID.StrOut
CALL SetCapturePrintQueue(CapQueue)
CALL StartLPTCapture(SCap)
Capstatus.Caption = "CAPTURE STATUS: CAPTURED"
END IF
END SUB
SUB Exit1_Click ()
UNLOAD Print1
Netdemo.SHOW
END SUB
SUB Form_Load ()
DIM SDefPrinter AS Capture
DIM CaptureStats AS CapStat
DIM GPFlags AS PFlags
IF LPTNum% = 0 THEN port$ = "LPT1"
IF LPTNum% = 1 THEN port$ = "LPT2"
IF LPTNum% = 2 THEN port$ = "LPT3"
Print1.Caption = "Print setup for port: " + port$
SDefPrinter.LPTNum = LPTNum%
CALL SetDefaultLocalPrinter(SDefPrinter)
CALL GetLPTCaptureStatus(CaptureStats)
IF CaptureStats.ReturnCode = 255 THEN
Capstatus.Caption = "CAPTURE STATUS: ACTIVE"
ELSE
Capstatus.Caption = "CAPTURE STATUS: NOT ACTIVE"
END IF
GPFlags.LPTNum = LPTNum%
CALL GetPrintFlags(GPFlags) 'Call the Procedure
IF CaptureStats.ReturnCode = 255 THEN
TabSize.text = STR$(GPFlags.TabSize)
Copies.text = STR$(GPFlags.Copies)
BannerText.text = GPFlags.BannerText
TimeOut.text = STR$(GPFlags.TimeOut)
ELSE
TabSize.text = ""
Copies.text = ""
BannerText.text = ""
TimeOut.text = ""
END IF
SELECT CASE GPFlags.Flags
CASE 8
BannerNo.Value = -1
TabsNo.Value = -1
FeedNo.Value = -1
CASE 64
BannerNo.Value = -1
TabsYes.Value = -1
FeedYes.Value = -1
CASE 72
BannerNo.Value = -1
TabsYes.Value = -1
FeedNo.Value = -1
CASE 128
BannerYes.Value = -1
TabsNo.Value = -1
FeedYes.Value = -1
CASE 136
BannerYes.Value = -1
TabsNo.Value = -1
FeedNo.Value = -1
CASE 192
BannerYes.Value = -1
TabsYes.Value = -1
FeedYes.Value = -1
CASE ELSE
BannerNo.Value = -1
TabsNo.Value = -1
FeedYes.Value = -1
END SELECT
END SUB
SUB Localmode_Click ()
DIM ECap AS Capture
ECap.LPTNum = LPTNum%
CALL EndSpecificLPTCapture(ECap)
Capstatus.Caption = "CAPTURE STATUS: NOT ACTIVE"
TabSize.text = ""
Copies.text = ""
BannerText.text = ""
TimeOut.text = ""
END SUB